#region Summary

// 
// Owner : JackieHan 
// 
// Solution : Skomart.Spider 
// 
// Project : Jackie.Utility
// 
// File : CodeCannotModifiedException.cs
// 
// CopyRight : Copyright © 2010-2011 Skomart Corporation, All Rights Reserved 
// 
// Summary : 编码不能修改异常
// 
// History : 
//			2010-09-26 16:11:40	    Create 
// 

#endregion

#region Using

using System;
using System.Collections.Generic;

#endregion

namespace Jackie.Utility.CustomException
{
    /// <summary> 
    /// 编码不能修改异常
    /// </summary>
    public class CodeCannotModifiedException : ApplicationException
    {
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="domainObject">实体对象</param>
        /// <param name="sValue">原值</param>
        /// <param name="tValue">目的值</param>
        public CodeCannotModifiedException(object domainObject, string sValue, string tValue)
            : base(string.Format("the Code property of object[{0}] cann't modify from [{1}] to [{2}]!", domainObject.GetType().Name, sValue, tValue))
        {
            this.DomainObject = domainObject;
            this.SourceValue = sValue;
            this.ToValue = tValue;
        }

        /// <summary>
        /// 获取修改发生的实体对象
        /// </summary>
        public object DomainObject { get; private set; }
        /// <summary>
        /// 获取原值
        /// </summary>
        public string SourceValue { get; private set; }
        /// <summary>
        /// 获取目的值
        /// </summary>
        public string ToValue { get; private set; }
    }
}